Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: validate that command contains one field #842

Merged
merged 1 commit into from
Feb 23, 2016

Conversation

dadgar
Copy link
Contributor

@dadgar dadgar commented Feb 23, 2016

Drivers that support a command field now validate that a single input is given.

@diptanu
Copy link
Contributor

diptanu commented Feb 23, 2016

LGTM

@ranjib
Copy link
Contributor

ranjib commented Feb 23, 2016

for docker images which has entrypoint /cmd specified in the dockerfile/metadata, this will not cause failure? or we expect to enforce passing command explicitly, always ?

@diptanu
Copy link
Contributor

diptanu commented Feb 23, 2016

@ranjib This shouldn't cause any issues with entrypoint stuff. This only throws an error if you have spaces in the Command key in the docker driver config.

diptanu added a commit that referenced this pull request Feb 23, 2016
drivers: validate that command contains one field
@diptanu diptanu merged commit 37e8248 into master Feb 23, 2016
@diptanu diptanu deleted the f-validate-command branch February 23, 2016 21:45
@ninoles
Copy link
Contributor

ninoles commented Sep 23, 2016

Is there any way to pass a command with space in it ? If that's not allowed, the warning should happen far before the driver execution and correctly documented.

Ideally, you should not simply do a lookup on space, but a full quoting check.

@dadgar
Copy link
Contributor Author

dadgar commented Sep 23, 2016

@ninoles Are you trying to do something like foo | bar > baz? If so your config should be:

command = "bash"
args = ["-c", "foo | bar > baz"]

@ninoles
Copy link
Contributor

ninoles commented Sep 23, 2016

#No, I'm trying to start "C:\Program Files\Python35\python.exe". I could push out to cmd.exe or powershell, but that's not ideal. I could also put the binary path in an environment variable and set command with it (the validation happen BEFORE variable replacement in the case of exec and raw_exec driver).

Also, one problem with it is the error report is confusing: "C:\Program Files\Python35\python.exe" doesn't have any arguments, so why it complains about it ?

In the end, I think the validation shouldn't happen, or at least shouldn't be an error. The config format is very well suited for supporting space in executable path, so why not allowing it ?

I open a bug in this regard: #1737

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants